<?php


namespace app\api\controller;

use app\common\bean\ContentBean;
use app\common\bean\OrderGoodsBean;
use app\common\controller\ApiController;
use app\common\manage\CategoryGroupManage;
use app\common\manage\ContentManage;
use app\common\utils\ExitJsonUtil;

class Service extends ApiController
{
    protected $beforeActionList = [
        'decryptToken' => ['except' => 'detail'],
    ];

    public function singlePrice(){//单价查询
        $price = CategoryGroupManage::getInstance()->singleRow($this->postParams['cids']);
        $price['uprice'] = CategoryGroupManage::getInstance()->getPrice($this->userId, $this->postParams['cids']);
        ExitJsonUtil::getInstance()->exitData($price);
    }

    public function detail(){//服务详情
        $contentBean = new ContentBean();
        $contentBean->setData($this->postParams);
        $contentBean = ContentManage::getInstance()->getInfo($contentBean);
        ExitJsonUtil::getInstance()->exitData($contentBean->getData());
    }
}